<!DOCTYPE html>
<html>
	
	<head>
		<meta charset="utf-8">
		<title>商品展示</title>
    </head>
	    
	
	
	<body>
		
		<div id="app">
		      <button  @click="getRigth()">获取数据</button>
		</div>
		<!--导入axios.js-->
		<script  src="../js/axios.js"></script>
		<!--导入vue.js-->
		<script  src="../js/vue.js"></script>
		
		<script>
			//
			async  function  getUser(){
				
				  const {data : result} = await  axios.get("http://localhost:8091/user/hello",{
					  
						  id : 1000,
						  name : "张三"
					  
				  });
				  
				  //设置cookie
				  var exp = new Date();
				  exp.setTime(exp.getTime()+1000*60*30*100);
				  document.cookie = "name=a" + ";expires=" + exp.toGMTString();
				  console.log(result);
				
			}
			
			
			getUser();
			
			
		
			
		const  app=new  Vue({
			   el: "#app",
			   data: {
				   name: ''
			   },
			   methods: {
				   async getRigth(){
				   		alert("点击");
				   		
				   		const {data : result} = await  axios.get("http://localhost:8091/rights/getRightsList",{},{withCredentials:true});
				   		  
				   		console.log(result);
				   	}
			   }
		})
			
			
			
		</script>
	</body>
</html>
